<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.4.4/babel.min.js"></script>
<script type="text/javascript">
    let arr = [1, 2, 3, 4, 10, 11];
    for (let number of arr) {
        console.log(`${number}`.padStart(2, '0'));
    }
    let date = new Date();
    console.log(('0' + (date.getMonth() + 1)));
    console.log([('0' + (date.getMonth() + 1)).slice(-2) + ('0' + date.getDate()).slice(-2)].join('  '));
    let strings = "a,b,c".split(',');
    console.log(strings);
    console.log([1, 2, 3].map(n => n ** 2));

    let obj = {a: 1, b: 2};
    let clone = {...obj, z: 3};
    console.log(clone);

    let obj1 = {a: 1};
    let obj2 = {b: 2};
    let obj3 = {c: 3};
    console.log(Object.assign({}, obj1, obj2, obj3));
    console.log({...obj1, ...obj2, ...obj3});
    console.log(Object.values(obj));
    console.log(Object.entries(obj));
    console.log(Object.getOwnPropertyDescriptors(obj));

    let ws = new WeakSet([obj1, obj2]);
    let wm = new WeakMap([[obj2, 1], [obj3, 2]]);
    console.log(ws);
    console.log(wm);

    console.log(2 ** 3);
    console.log(2 ** 3 ** 2);//512=2**(3**2)

    let reg = /hello?/igu;
    console.log(reg.flags); // giu

    let menuData = [
        {text: '主页', url: '/home'},
        {text: '产品', url: '/products'},
        {text: '服务', url: '/services'},
        {text: '关于我们', url: '/about-us'},
        {text: '联系我们', url: '/contact-us'}
    ];
    let menu = `
        <ul>
        ${menuData.map(item => `<li><a href="${item.url}">${item.text}</a></li>`).join('')}
        </ul>
    `;
    document.body.innerText = menu;

    console.log([1, 4, -5, 10].find(n => n < 0));

    class SuperClass {
        method(value) {
            console.log(value);
        };
    }

    class SubClass extends SuperClass {
        method(value) {
            console.log(value);
            super.method(23333);
        }
    }

    console.log(new SubClass().method(23));

</script>
</body>
</html>